/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package game;

import define.PhongChoi;
import java.awt.Graphics;

/**
 *
 * @author CONGMAN
 */
public class QuanLiGame {

    private TrangThaiGame TrangThaiHienTai;
    private GameObject[] Ob;

    public QuanLiGame()
    {
        TrangThaiHienTai =  TrangThaiGame.Menu;
        Ob = new GameObject[3];
        Ob[0] = new MenuGame();
        Ob[1] = new PhongCho();
        Ob[2] = new PhongChoi();
    }

    public void draw(Graphics g)
    {
        if (TrangThaiHienTai == TrangThaiGame.Menu)
            Ob[0].draw(g);
        else{
            if(TrangThaiHienTai == TrangThaiGame.PhongCho)
                Ob[1].draw(g);
            else
                Ob[2].draw(g);
        }
    }

    public void update()
    {
        if (TrangThaiHienTai == TrangThaiGame.Menu)
            Ob[0].update();
        else{
            if(TrangThaiHienTai == TrangThaiGame.PhongCho)
                Ob[1].update();
            else
                Ob[2].update();
        }
    }

    /**
     * @return the TrangThaiHienTai
     */
    public TrangThaiGame getTrangThaiHienTai() {
        return TrangThaiHienTai;
    }

    /**
     * @param TrangThaiHienTai the TrangThaiHienTai to set
     */
    public void setTrangThaiHienTai(TrangThaiGame TrangThaiHienTai) {
        this.TrangThaiHienTai = TrangThaiHienTai;
    }

    /**
     * @return the Ob
     */
    public GameObject[] getOb() {
        return Ob;
    }

    /**
     * @param Ob the Ob to set
     */
    public void setOb(GameObject[] Ob) {
        this.Ob = Ob;
    }
}
